﻿@model ElingOA6_Admin_DSJCJ.Areas.Admin.Models.DocumentClsViewModel
@helper comboxFQBMDept(string pronoun, string authorityType)
    {
        var tmpList = Model.DocClsAuthorityList.Where(s => s.FPronoun == pronoun && s.FAuthorityType == authorityType).ToList();
        ComboBoxSettings comboSetting = new ComboBoxSettings();
        comboSetting.Name = "cbo_" + authorityType + "_" + pronoun;
        comboSetting.Width = 100;
        comboSetting.Properties.TextField = "Text";
        comboSetting.Properties.ValueField = "Value";
        comboSetting.Properties.DropDownStyle = DropDownStyle.DropDownList;
        comboSetting.Properties.EnableAnimation = false;
        if (tmpList.Count() > 0)
        {
    @Html.DevExpress().ComboBox(comboSetting).BindList(ViewData["clsAuthorityPropSelection"]).Bind(tmpList[0].FProp).GetHtml()
        }
        else
        {
    @Html.DevExpress().ComboBox(comboSetting).BindList(ViewData["clsAuthorityPropSelection"]).Bind(
                                        (ViewData["clsAuthorityPropSelection"] as List<SelectListItem>)[0].Value
    ).GetHtml()
        
        }
}
<table class="tableForm">
    <tr>
        <td>
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageQJ";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "ALL" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "全局";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkQJ_ValueChanged('Manage')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkQJ_ValueChanged('Manage')}";
                    }).GetHtml()
        </td>
    </tr>
</table>
<table class="tableForm" id="tableManage"  style="display:none">
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageFQBM";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "DEPT0" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "发起部门";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM','cbo_MANAGE_DEPT0')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM','cbo_MANAGE_DEPT0')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT0", "MANAGE")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageFQBM_DEPT1";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "DEPT1" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "发起部门上级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT1','cbo_MANAGE_DEPT1')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT1','cbo_MANAGE_DEPT1')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT1", "MANAGE")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageFQBM_DEPT2";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "DEPT2" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "发起部门上2级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT2','cbo_MANAGE_DEPT2')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT2','cbo_MANAGE_DEPT2')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT2", "MANAGE")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageFQBM_DEPT3";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "DEPT3" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "发起部门上3级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT3','cbo_MANAGE_DEPT3')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT3','cbo_MANAGE_DEPT3')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT3", "MANAGE")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageFQBM_DEPT4";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "DEPT4" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "发起部门上4级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT4','cbo_MANAGE_DEPT4')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT4','cbo_MANAGE_DEPT4')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT4", "MANAGE")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageFQBM_DEPT5";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "DEPT5" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "发起部门上5级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT5','cbo_MANAGE_DEPT5')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT5','cbo_MANAGE_DEPT5')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT5", "MANAGE")</td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageFQBM_DEPT6";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "DEPT6" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "发起部门上6级";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT6','cbo_MANAGE_DEPT6')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkFQBM_ValueChanged('chkManageFQBM_DEPT6','cbo_MANAGE_DEPT6')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @comboxFQBMDept("DEPT6", "MANAGE")</td>
    </tr>
    <tr>
        <td colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageCharge";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "CHARGE" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "分管领导";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td class="tdClass" colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageBM";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "ASSIGNDEPT" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "指定部门";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkBM_ValueChanged('Manage')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkBM_ValueChanged('Manage')}";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <table width="70%" id="tableManageBM" style="display:none" align="center" cellpadding="0" cellspacing="0" bordercolordark="white" bordercolorlight="#BEBEBE">
                <tr>
                    <th width="20%" style="text-align: center">
                        <img src="@Url.Content("~/Content/images/add.gif")" style="cursor:pointer"  onclick="addRowBm('Manage');"/>&nbsp;操作</th>
                    <th width="50%" style="text-align: center">
                        部门</th>
                    <th width="30%" style="text-align: center">
                        级别</th>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="tdClass" colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageGZZ";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "GROUP" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "指定工作组";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkGZZ_ValueChanged('Manage')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkGZZ_ValueChanged('Manage')}";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <table width="70%" id="tableManageGZZ" style="display:none" align="center" cellpadding="0" cellspacing="0" bordercolordark="white" bordercolorlight="#BEBEBE">
                <tr>
                    <th width="20%" style="text-align: center">
                        <img src="@Url.Content("~/Content/images/add.gif")" style="cursor:pointer"  onclick="addRowGZZ('Manage');"/>&nbsp;操作</th>
                    <th width="50%" style="text-align: center">
                        工作组</th>
                    <th width="30%" style="text-align: center">
                        级别</th>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td class="tdClass" colspan="2">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageGW";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "POST" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "指定岗位";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkGW_ValueChanged('Manage')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkGW_ValueChanged('Manage')}";
                    }).GetHtml()
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <table width="70%" id="tableManageGW" style="display:none" align="center" cellpadding="0" cellspacing="0" bordercolordark="white" bordercolorlight="#BEBEBE">
                <tr>
                    <th width="20%" style="text-align: center">
                        <img src="@Url.Content("~/Content/images/add.gif")" style="cursor:pointer"  onclick="addRowGW('Manage')"/>&nbsp;操作</th>
                    <th width="80%" style="text-align: center" colspan="2">
                        岗位</th>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageYHZ";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "ROLE" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "指定用户组";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkYHZ_ValueChanged('Manage')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkYHZ_ValueChanged('Manage')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @Html.DevExpress().ButtonEdit(settings =>
       {
           settings.Name = "txtManageYHZ";
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
           settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.ReadOnly = true;
           //settings.Text = ViewData["FEmpName"].ToString(); ;
           settings.Properties.Buttons.Add("选择");
           settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseGroup('Manage')}";
           //settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'对应员工')}";
       }).GetHtml()
        </td>
    </tr>
    <tr>
        <td style="width: 15%">
            @Html.DevExpress().CheckBox(
                    settings =>
                    {
                        settings.Name = "chkManageUser";
                        settings.Checked = Model.DocClsAuthorityList.Exists(s => s.FPronoun == "PERSON" && s.FAuthorityType == "MANAGE") ? true : false;
                        settings.Text = "指定人";
                        settings.Properties.ClientSideEvents.Init = "function(s,e){chkUser_ValueChanged('Manage')}";
                        settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){chkUser_ValueChanged('Manage')}";
                    }).GetHtml()
        </td>
        <td style="width: 85%" class="tdClass">
            @Html.DevExpress().ButtonEdit(settings =>
       {
           settings.Name = "txtManageUser";
           settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
           settings.Height = System.Web.UI.WebControls.Unit.Percentage(100);
           settings.ReadOnly = true;
           //settings.Text = ViewData["FEmpName"].ToString(); ;
           settings.Properties.Buttons.Add("选择");
           settings.Properties.ClientSideEvents.ButtonClick = "function(s,e){chooseUser('Manage')}";
           //settings.Properties.ClientSideEvents.Validation = "function(s,e){notEmptyValidation(s,e,'对应员工')}";
       }).GetHtml()
        </td>
    </tr>
</table>
